#ifndef VIEWPLANE_H
#define VIEWPLANE_H

#include "Vector3D.h"
#include "Ray3D.h"
#include "ProjectionMode.h"

namespace RayTracer
{
    class ViewPlane
    {
    private:
	float left;
	float right;
	float top;
	float bottom;
	float scrW;
	float scrH;
	ProjectionMode projMode;
	Vector3D perspectiveOrigin;
	Vector3D orthoDir;

	void ResetEyePosition();
	Vector3D GetRayOrigin(const Vector3D *viewPlanePoint) const;
	Vector3D GetRayDirection(const Vector3D *viewPlanePoint) const;
	Vector3D ScreenToViewPlane(float x, float y) const;
    public:	
	ViewPlane(ProjectionMode projMode);
	void Resize(float w, float h);
	Ray3D GetViewRay(float x, float y) const;
		
	ProjectionMode GetProjectionMode() const;
	void SetProjectionMode(ProjectionMode value);
    };
};
#endif
